package org.rcp.collect;

import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;

public class DetailEditorInput implements IEditorInput {
	
	private String deviceName;

	public DetailEditorInput(String deviceName) {
		super();
		Assert.isNotNull(deviceName);
		this.deviceName = deviceName;
	}

	@Override
	public Object getAdapter(Class adapter) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean exists() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public ImageDescriptor getImageDescriptor() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return deviceName;
	}

	@Override
	public IPersistableElement getPersistable() {
		// TODO Auto-generated method stub
		return null;
	}
	
	public boolean equals(Object obj) {
		if (super.equals(obj))
			return true;
		if (!(obj instanceof DetailEditorInput))
			return false;
		DetailEditorInput other = (DetailEditorInput) obj;
		return this.deviceName.equals(other.deviceName);
	}

	@Override
	public String getToolTipText() {
		// TODO Auto-generated method stub
		return deviceName;
	}

}
